Skip to content

5.0.1-beta-1#88

Open
rajnandan1 wants to merge 1 commit intomasterfrom
5.0.1-beta-1
Open

5.0.1-beta-1#88
rajnandan1 wants to merge 1 commit intomasterfrom
5.0.1-beta-1

Conversation

@rajnandan1
Copy link
Contributor

Raising PR to github

Copilot AI review requested due to automatic review settings January 16, 2026 11:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request upgrades the Cashfree Payment Gateway SDK from Pydantic v1 to Pydantic v2, updating the version to "5.0.1-beta-1". The changes include updating the Pydantic dependency constraint and migrating all model classes to use Pydantic v2's syntax.

Changes:

  • Updated Pydantic dependency from >= 1.10.24, < 2 to >= 2.11.7
  • Migrated all Pydantic model classes from v1 Config class to v2 model_config dictionary
  • Replaced @validator decorators with @field_validator decorators
  • Updated SDK version to "5.0.1-beta-1" in setup.py, pyproject.toml, and configuration.py

Reviewed changes

Copilot reviewed 267 out of 268 changed files in this pull request and generated 228 comments.

Show a summary per file
File Description
setup.py Updated version to 5.0.1-beta-1 and Pydantic dependency to >= 2.11.7
pyproject.toml Updated version to 5.0.1-beta-1
configuration.py Updated SDK package version string to 4.5.1
cashfree_pg/models/*.py Migrated 200+ model files from Pydantic v1 to v2 syntax
cashfree_pg/api_response.py Added compatibility comment for Pydantic v2

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +39 to 40
@field_validator('channel')
def channel_validate_enum(cls, value):
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @field_validator decorator in Pydantic v2 requires a mode parameter when used without @classmethod. In Pydantic v2, validators should use @field_validator('field_name', mode='before') or @field_validator('field_name', mode='after'). The current usage may not work correctly. This applies to all field validators in the codebase.

Copilot uses AI. Check for mistakes.
"Python Version: {pyversion}\n"\
"Version of the API: 2023-08-01\n"\
"SDK Package Version: 4.3.10".\
"SDK Package Version: 4.5.1".\
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SDK Package Version in the debug report string is hardcoded to "4.5.1" but the actual package version has been updated to "5.0.1-beta-1" in setup.py and pyproject.toml. This creates an inconsistency that will confuse users when debugging. Update this to match the new version.

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +24
from pydantic import Field

# Updated imports for Pydantic v2 compatibility
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Field import is added but not used in this enum class. This import should be removed to avoid unused imports.

Copilot uses AI. Check for mistakes.

from typing import Optional
from pydantic import BaseModel, Field, StrictStr
from pydantic import field_validator
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'field_validator' is not used.

Suggested change
from pydantic import field_validator

Copilot uses AI. Check for mistakes.
Comment on lines +24 to 25
from pydantic import field_validator

Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'field_validator' is not used.

Suggested change
from pydantic import field_validator

Copilot uses AI. Check for mistakes.
from typing import List, Optional
from pydantic import BaseModel, conlist
from cashfree_pg.models.vendor_entity_related_docs_inner import VendorEntityRelatedDocsInner
from pydantic import field_validator
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'field_validator' is not used.

Copilot uses AI. Check for mistakes.
from cashfree_pg.models.bank_details import BankDetails
from cashfree_pg.models.schedule_option import ScheduleOption
from cashfree_pg.models.vendor_entity_related_docs_inner import VendorEntityRelatedDocsInner
from pydantic import field_validator
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'field_validator' is not used.

Copilot uses AI. Check for mistakes.

from typing import Optional
from pydantic import BaseModel, StrictStr
from pydantic import field_validator
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'field_validator' is not used.

Copilot uses AI. Check for mistakes.

from typing import Any, Dict, Optional, Union
from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr
from pydantic import field_validator
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'field_validator' is not used.

Copilot uses AI. Check for mistakes.

from typing import Optional
from pydantic import BaseModel, StrictStr
from pydantic import field_validator
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'field_validator' is not used.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants